﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UITesting.WinControls;
using System.Diagnostics;
using Microsoft.VisualStudio.TestTools.UITesting;
using BackOffice.Context.UltiPro.BackOfficeUIMapClasses;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using System.Windows.Input;
using BackOffice.Context.UltiPro.PageObjects;

namespace BackOffice.Context.UltiPro.Macros
{
    /// <summary>
    /// Code Setup macros
    /// </summary>
    public class CodeSetupMacros
    {
        /// <summary>
        /// Gets the UI map.
        /// </summary>
        /// <value>
        /// The UI map.
        /// </value>
        private static BackOfficeUIMap UIMap
        {
            get
            {
                return new BackOfficeUIMap();
            }
        }

        /// <summary>
        /// The screen name
        /// </summary>
        private const string ScreenName = "CodeSetup";

        /// <summary>
        /// Selects the code.
        /// </summary>
        /// <param name="code">The code.</param>
        public static void SelectCode(string code)
        {
            Mouse.Click(CodeSetup.TreeItemCode(code));
        }

        /// <summary>
        /// Clicks the add button.
        /// </summary>
        public static void ClickAddButton()
        {
            UIMacros.ClickAddButton(ScreenName);
        }

        /// <summary>
        /// Clicks the delete button.
        /// </summary>
        public static void ClickDeleteButton()
        {
            UIMacros.ClickDeleteButton(ScreenName);
        }

        /// <summary>
        /// Clicks the save button.
        /// </summary>
        public static void ClickSaveButton()
        {
            UIMacros.ClickSaveButton(ScreenName);
        }

        /// <summary>
        /// Clicks the undo button.
        /// </summary>
        public static void ClickUndoButton()
        {
            UIMacros.ClickUndoButton(ScreenName);
        }

        /// <summary>
        /// Clicks the refresh button.
        /// </summary>
        public static void ClickRefreshButton()
        {
            UIMacros.ClickRefreshButton(ScreenName);
        }

        /// <summary>
        /// Clicks the save as button.
        /// </summary>
        public static void ClickSaveAsButton()
        {
            UIMacros.ClickSaveAsButton(ScreenName);
        }

        /// <summary>
        /// Clicks the company code filter button.
        /// </summary>
        public static void ClickCompanyCodeFilterButton()
        {
            UIMacros.ClickSaveAsButton(ScreenName);
        }
    }
}
